package o;

import android.content.Context;
import java.security.SecureRandom;
import java.util.List;

public class dpu extends dpn<b, Boolean> {

    protected enum b {
        NO_EXECUTE,
        EXECUTE
    }

    protected /* synthetic */ Object ˋ(Context context, Object obj) throws InterruptedException {
        return ˏ(context, (b) obj);
    }

    protected /* synthetic */ Object ॱ(Context context) throws InterruptedException {
        return ˋ(context);
    }

    public dpu() {
        this.ˊ = "BaseAppsUpdateTask";
    }

    protected b ˋ(Context context) {
        return b.EXECUTE;
    }

    protected Boolean ˏ(Context context, b bVar) {
        if (bVar == b.NO_EXECUTE) {
            return Boolean.valueOf(false);
        }
        Logger.ˎ("ScheduleRepeatService", this.ˊ + " execute " + bVar);
        ॱ();
        List ˊ = dss.ॱ().ˊ(true, 1);
        if (dug.ˎ(false) != 0) {
            return Boolean.valueOf(false);
        }
        List<String> ˊ2 = dss.ॱ().ˊ(true, 1);
        if (ˊ2.size() <= 0) {
            Logger.ˎ(this.ˊ, "not have recommend upgrade,need not to show update notification");
            dss.ॱ().ˊ(context);
            return Boolean.valueOf(true);
        }
        boolean z;
        for (String contains : ˊ2) {
            if (!ˊ.contains(contains)) {
                z = true;
                break;
            }
        }
        z = false;
        if (z) {
            ˎ(context);
            return Boolean.valueOf(true);
        }
        Logger.ˎ(this.ˊ, "do not find new upgrade");
        return Boolean.valueOf(true);
    }

    private void ॱ() {
        if (dss.ॱ().ʻॱ()) {
            int ॱ = edl.ˏ().ॱ();
            if (ॱ != 0) {
                try {
                    Thread.sleep((long) new SecureRandom().nextInt(ॱ));
                } catch (InterruptedException e) {
                    Logger.ˎ("BaseAppsUpdateTask", "sleep error");
                }
            }
        }
    }

    protected void ˏ(Context context, b bVar, Boolean bool) {
    }

    private void ˎ(Context context) {
        if (dss.ॱ().ˊ()) {
            Logger.ˎ("BaseAppsUpdateTask", "update do not disturb , can not show Update notify.");
        } else if (doo.ʼ(ContentManager.getInstant().getContext()) == 1 && dss.ॱ().ˎ()) {
            Logger.ˎ("BaseAppsUpdateTask", "netType is wifi,and PreUpdate has been opend,can not show Update notify.");
        } else {
            if (dss.ॱ().ˋॱ() <= dss.ॱ().ˋ(dqb.ˏ())) {
                Logger.ˎ("BaseAppsUpdateTask", "Up to MAX UPDATE SIZE,can not show Update notify.");
                return;
            }
            Logger.ˎ("BaseAppsUpdateTask", "showUpdateNotification()");
            dss.ॱ().ˎ(context);
        }
    }
}
